package com.xxl.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Email;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Date;

/**
 * 用户实体类
 * @author xxl
 * @date 2023/3/29
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "UserDto",title = "用户实体类对象")
public class UserDto implements Serializable {
    @Schema(title = "用户名")
    private String username;
    @Schema(title = "用户密码")
    private String password;
    @Schema(title = "用户邮箱")
    private String email;
    /**
     *  用户头像的在服务器的地址
     */
    @Schema(title = "头像地址在服务器地址")
    private String imageAddress;
    /**
     * 角色
     */
    @Schema(title = "用户角色实体类对象")
    private RoleDto roleDto;
    @Schema(title = "用户角色id")
    private int roleId;
    @Schema(title = "性别")
    private Integer gender;
    @Schema(title = "出生日期")
    private Date birth;

    public UserDto(String username, String password, String email, String imageAddress, RoleDto roleDto, int roleId) {
        this.username = username;
        this.password = password;
        this.email = email;
        this.imageAddress = imageAddress;
        this.roleDto = roleDto;
        this.roleId = roleId;
    }
}
